To do app is a simple to-do list application that allows users to manage tasks by logging in with their email and password or using their Google account.
- Front-end: Next.js, React
- Back-end: Node.js, Express
- Database: PostgreSQL
- Authentication: Firebase
- Deployment: Docker-compose
Before running the application, ensure you have Docker installed on your computer.
-
Clone the repository:
git clone git@github.com:carvalhaus/todoapp.git
-
Navigate to the project directory:
cd todoappChange into the directory where you cloned the repository.
-
Ensure all necessary environment variables are set up to execute the project
Create a file named
.env.localin theclientfolder and define the following variables:NEXT_PUBLIC_FIREBASE_API_KEY: Your Firebase API key.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: Your Firebase authentication domain.NEXT_PUBLIC_FIREBASE_PROJECT_ID: Your Firebase project ID.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: Your Firebase storage bucket.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: Your Firebase messaging sender ID.NEXT_PUBLIC_FIREBASE_APP_ID: Your Firebase app ID.
Create a file named
.envin theserverfolder and configure these variables:DATABASE_URL: URL to connect to your PostgreSQL database.- Download your Firebase service account private key file. Follow these steps:
- In the Firebase Console, navigate to Settings > Service Accounts.
- Click on Generate new private key, then Generate key to confirm.
- Securely store the downloaded JSON file containing the private key.
- Encode the Firebase JSON file to base64 and store it in
FIREBASE_CONFIG_BASE64in your.envfile:
- Linux:
base64 server/firebase-admin.json > server/encoded.json- Windows (PowerShell):
[Convert]::ToBase64String([System.IO.File]::ReadAllBytes(".\server\firebase-admin.json")) | Out-File -Encoding ASCII .\server\encoded.json
This command encodes the contents of
server/firebase-admin.jsoninto base64 format and saves it inserver/encoded.json.Create a file named
.envin thetodoappfolder (where your Docker-compose file resides) and set these variables:POSTGRES_DB: Name of your PostgreSQL database.POSTGRES_USER: PostgreSQL username.POSTGRES_PASSWORD: PostgreSQL password.DATABASE_URL: URL to connect to your PostgreSQL database.
Ensure these environment variables are correctly configured before building and running the application.
-
Run the following commands:
docker-compose build docker-compose up -d
This will build and start containers for the backend, frontend, and database.
Once the containers are up and running, you can access the application at http://localhost:3000 in your browser.
If you want to consult the API documentation, access http://localhost:3001/api/api-docs.
- User authentication with email/password or Google account
- Create, update, and delete tasks
- Mark tasks as completed
- Responsive user interface
Contributions are welcome! If you'd like to contribute to the project, please fork the repository and submit a pull request with your changes.
For questions or support, please contact me.