Skip to content

EcoSync is a full-stack application built with Next.js, Flutter, Express.js, Prisma, and PostgreSQL. It is a software where we solved the waste collection and dumping solution of Dhaka North City Corporation. This project made our champion in the CODE SAMURAI 2024.

Notifications You must be signed in to change notification settings

definecoder/CS24-p2-define-coders

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcoSync by DEFINE CODERS

EcoSync is a full-stack application built with Next.js, Express.js, Prisma, and PostgreSQL.

Project Structure

The project is divided into two main directories:

  • /client - Contains the Next.js frontend application.
  • /server - Contains the Express.js backend server, which uses Prisma for ORM and PostgreSQL as the database.

Prerequisites

Before you begin, ensure you have installed:

  • Node.js and npm
  • PostgreSQL

Installation

  1. Clone the repository:
git clone https://github.com/definecoder/CS24-p2-define-coders.git
  1. Install the dependencies in both the /client and /server directories:
cd EcoSync/client
npm install

cd ../server
npm install

Configuration

In the /server & /client directory, rename .env.example to .env and fill in your PostgreSQL database details with you postgres password e.g: "postgresql://postgres:YOURPASSWORDHERE@127.0.0.1:5432/ecosync" and other environment variables from this google doc link.

Running the Application

  1. Start the backend server:
cd EcoSync/server
npm run dev
  1. In a new terminal window, start the frontend application:
cd EcoSync/client
npm run dev

The frontend application will be available at http://localhost:3000, and the backend server will be running at http://localhost:8585 (or whatever port you specified).

Credentials set by the initial db migration

{
  "SYSTEM_ADMIN": {
    "email": "admin@admin",
    "password": "admin"
  },
  "LAND_MANAGER": {
    "email": "codermehraj@gmail.com",
    "password": "admin"
  },
  "STS_MANAGER": {
    "email": "shafinnafiullah@gmail.com",
    "password": "admin"
  }
}

To run using Docker

Go to the source directory and give the following command

docker compose up --build

To run using AWS Backend (if docker compose fails)

Go to client\data\apiRoutes and comment the first line and uncomment the second

export const baseUrl = "http://localhost:8585"; // Uncomment to run Locally 
// export const baseUrl = "http://13.250.36.61"; // Uncomment to run in AWS

When running on AWS the frontend might face some slow network problems which can be fixed by switching speed from no thorttling to fast 3G. You can check this video to see the demonstration of the problem mentioned here.

License

MIT

About

EcoSync is a full-stack application built with Next.js, Flutter, Express.js, Prisma, and PostgreSQL. It is a software where we solved the waste collection and dumping solution of Dhaka North City Corporation. This project made our champion in the CODE SAMURAI 2024.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •