EcoSync is a full-stack application built with Next.js, Express.js, Prisma, and PostgreSQL.
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.
Before you begin, ensure you have installed:
- Node.js and npm
- PostgreSQL
- Clone the repository:
git clone https://github.com/definecoder/CS24-p2-define-coders.git- Install the dependencies in both the
/clientand/serverdirectories:
cd EcoSync/client
npm install
cd ../server
npm installIn 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.
- Start the backend server:
cd EcoSync/server
npm run dev- In a new terminal window, start the frontend application:
cd EcoSync/client
npm run devThe 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).
{
"SYSTEM_ADMIN": {
"email": "admin@admin",
"password": "admin"
},
"LAND_MANAGER": {
"email": "codermehraj@gmail.com",
"password": "admin"
},
"STS_MANAGER": {
"email": "shafinnafiullah@gmail.com",
"password": "admin"
}
}Go to the source directory and give the following command
docker compose up --buildGo 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 AWSWhen 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.
