PtC Dashboard is a React-based web application designed to facilitate community-led urban governance. This project leverages various modern web technologies to provide a seamless and interactive user experience.
- Interactive maps with Mapbox
- Real-time notifications with Socket.io
- Multi-language support with i18next
- Responsive design with Tailwind CSS
- Form handling with Headless UI
- Data visualization and QR code generation
To get a local copy up and running, follow these simple steps.
Make sure you have the following installed on your local machine:
- Node.js (v14 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/your-username/ptc-dashboard.git cd ptc-dashboard
-
Install the dependencies:
npm install
To start the development server, run:
npm run dev
This will start the Vite development server and you can view the application by navigating to http://localhost:3000 in your web browser.
To build the project for production, run:
npm run build
The built files will be in the dist
directory.
ptc-dashboard
is part of permissioning-city-engine
. It is going to be deplyed as one of the containers in the docker-compose.yml
or docker-compose.prod.yml
according to the deployment environment.
docker-entrypoint.sh
is going to run on container start.
# docker-entrypoint.sh
#!/bin/bash
set -e
echo "Install packages..."
npm i
echo "Package installation complete!"
echo "Building application..."
npm run build
echo "Application build complete!"
if [ "$NODE_ENV" = "production" ]; then
# In production mode, the compiled application will be served
echo "Production environment detected, serving the app..."
npm i -g [email protected]
serve -s dist
else
echo "Non-production environment detected, tailing /dev/null..."
# In development mode, the on-development application will be served via pm2
npm i -g [email protected]
pm2 start --name "ptc-dashboard" npm -- run start
pm2 logs
tail -f /dev/null
fi
React: A JavaScript library for building user interfaces. Vite: A fast build tool and development server. Tailwind CSS: A utility-first CSS framework. Mapbox GL: A JavaScript library for interactive, customizable vector maps. Socket.io: A library for real-time web applications. i18next: An internationalization framework for JavaScript. Headless UI: Unstyled, fully accessible UI components. Day.js: A minimalist JavaScript library for date and time manipulation.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request