Welcome to the voyage-tasks
project! This README serves as the central guide for understanding, running, and contributing to the project. A well-maintained README is as crucial to a project's success as the code itself, so we encourage you to treat this document with the same care.
- Project Overview
- How to Run the Application
- Environment Setup
- Database Setup and Prisma Migrations
- Team Documents
- Our Team
preview on figma
The voyage-tasks
project is developed by a collaborative team within the Chingu Community. This project aims to streamline task management with features for scheduling appointments, tracking progress, and managing user information. The project is structured using Docker and Prisma for database management, with a backend API developed in Next.js to handle user requests and appointments.
For more insights into writing a great README, refer to this article by an experienced Chingu member: Keys to a well-written README.
Follow these steps to set up and run the application locally:
-
Install Dependencies
First, install the required dependencies by running:
npm install
-
Run Docker Compose
Ensure Docker is installed and running on your machine. Navigate to the root of the project directory and execute:
docker-compose up -d
This command will start a PostgreSQL database as defined in
docker-compose.yml
with persistent storage, ensuring data retention across restarts. -
Set Up Environment Variables
In the root directory, create a
.env
file with the following content:DATABASE_URL="postgresql://docker:docker@localhost:5432/apisippy"
Ensure that
DATABASE_URL
matches the credentials and database settings configured indocker-compose.yml
.Create a environment variable called
AUTH_SECRET
and assign some string (any string) to it. This is used by NextAuth to generate a token.To enable address autocomplete functionality, you need to set up a Google API key and assign it to an environment variable named
GOOGLEMAPS_API_KEY
. This key is required for using the Google Places API to fetch address suggestions. Click here for instructions on how to obtain the key.To render the map, you'll need an environment variable that is available on the client side. Create
NEXT_PUBLIC_GOOGLEMAPS_API_KEY
and use the same value as your Google Maps API key.In your Google console, ensure that the
Places
,PlacesDetails
,Directions
APIs are switched on.- Create a free account at https://ethereal.email/
- Copy credentials (user, password and host) and paste them into the appropriate environment variables:
SMTP_HOST=smtp.ethereal.email
(or whatever ethereal indicates)SMTP_USER=<copy from ethereal>
SMTP_PASSWORD=<copy from ethereal>
SMTP_FROM="'Admin' <[email protected]>"
- Supply your own custom values for the environment variables
ADMIN_USERNAME
ADMIN_PASSWORD
.
-
Generate Prisma Client
To generate the Prisma client based on the defined schema, run:
npm run prisma:generate
-
Run Prisma Migrations
Apply migrations to the PostgreSQL database to set up the initial schema:
npm run prisma:migrate
This command will create tables and relationships as specified in
prisma/schema.prisma
. -
Start the Development Server
Finally, start the Next.js development server:
npm run dev
The application should now be running locally. Visit http://localhost:3000 to view the project in your browser.
- Sign up for Google Cloud and navigate to your console https://console.cloud.google.com/
- Create an oAuth consent screen
- The Callback url for dev is
http://localhost:3000/api/auth/callback/google
- Copy your Google clientID and secret to the
.env
- Sign up for Github oAuth in Settings / Developer Settings
- Enter relavent app details
- The Callback url for dev is
http://localhost:3000/api/auth/callback/github
- Generate a secret and copy and paste ID and secret to appropriate
.env
variable
To ensure a consistent development experience, configure the following:
- Node.js & npm: Make sure Node.js and npm are installed on your machine.
- Docker: Required for containerizing the PostgreSQL database.
- Environment Variables: Configure the
.env
file as described above.
This project uses Prisma as the ORM and PostgreSQL as the database. Here are the main steps:
- Define Services in
docker-compose.yml
for containerized environments, with PostgreSQL setup using the Bitnami PostgreSQL image and persistent storage. - Prisma Scripts: Scripts for Prisma (
prisma:generate
,prisma:migrate
, andprisma:deploy
) are added to thepackage.json
for easy schema management and migrations. - Database Schema: The schema includes tables like
users
,resident_requests
,addresses
, andtime_slots
, all with defined relationships and constraints.
Review the FAQ https://ethereal.email/faq
- All e-mails sent by our service are mocked and will be intercepted by Ethereal.
- Log into your Ethereal mailbox to inspect the e-mails.
- You can upgrade users to admin status by having them enter the credentials in the
Admin Tool
. - Click on
ADMIN TOOL
on the home page (it is at the buttom in the footer, note: this is only visible for users who have a session and are NOT already admins). - A credentials page will be displayed, allowing them to enter the admin username and password.
- If successful, their
isAdmin
flag will be set totrue
, and they will be directed to the dashboard.
Meet our awesome team! Everyone has added their GitHub and LinkedIn profiles for easy access.
- Suruchi Patki: GitHub / LinkedIn
- David Eastmond: GitHub / LinkedIn
- Mahyar Erfanian: GitHub / LinkedIn
- Franklin Macedo: GitHub / LinkedIn
- Nandor Nagy: GitHub / LinkedIn
- Eoin McDonnell: GitHub / LinkedIn
This project is built and maintained as part of the Chingu Community. We're constantly learning, adapting, and collaborating, so expect more updates and enhancements as we progress. We welcome feedback, contributions, and suggestions.
- Suruchi Patki: GitHub / LinkedIn
- David Eastmond: GitHub / LinkedIn
- Mahyar Erfanian: GitHub / LinkedIn
- Franklin Macedo: GitHub / LinkedIn
- Nandor Nagy: GitHub / LinkedIn
- Eoin McDonnell GitHub / LinkedIn...
As the project evolves, additional features, components, and updates will be documented here. Stay tuned for more detailed posts as we continue building together!