|
|
||
|---|---|---|
| .cursor/rules | ||
| prisma | ||
| scripts | ||
| src | ||
| .env.example | ||
| .env.production.template | ||
| .gitignore | ||
| DEPLOYMENT.md | ||
| README.md | ||
| RULES.md | ||
| backup-db.sh | ||
| check-db.sh | ||
| contact-boilerhaus-org.conf | ||
| contacts-boilerhaus-org.conf | ||
| deploy.sh | ||
| import-data.js | ||
| next.config.js | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| push-to-gitea.sh | ||
| requirements.txt | ||
| run-dev.sh | ||
| stones_data.sql | ||
| stones_data_only.sql | ||
| tailwind.config.js | ||
| tsconfig.json | ||
README.md
Stones Database
A web application for managing contacts and their blockchain-related information, including NFT holdings, DAO memberships, and token holdings.
Development Setup
Prerequisites
- Node.js (v16 or higher)
- PostgreSQL database
- Git
Setup Instructions
- Clone the repository
git clone git@git.boilerhaus.org:boiler/stones.git
cd stones
- Install dependencies
npm install
- Set up the database
- Create a PostgreSQL database named
stones - Update the
.env.localfile with your database connection string:
DATABASE_URL="postgresql://username:password@localhost:5432/stones"
- Run database migrations
npx prisma migrate dev
npx prisma generate
- Start the development server
npm run dev
# or
./run-dev.sh
This will start the application at http://localhost:3000.
Utility Scripts
This project includes several utility scripts to streamline the development and deployment process:
run-dev.sh: Starts the development server with all necessary checkscheck-db.sh: Tests database connectivity and displays database statisticspush-to-gitea.sh: Pushes changes to the Gitea repositorydeploy.sh: Deploys the application to a production serverbackup-db.sh: Creates a backup of the PostgreSQL database
Using the Development Server
To run the development server with automatic checks for dependencies and database setup:
./run-dev.sh
This script will:
- Check for Node.js and npm
- Create a
.env.localfile if it doesn't exist - Install dependencies if needed
- Run database migrations
- Start the development server
Checking Database Connectivity
To test your database connection and view statistics:
./check-db.sh
This script will connect to your database and display the number of contacts, NFT holdings, DAO memberships, and token holdings.
Authentication
The application uses a simple authentication system with a hardcoded admin user:
- Username:
admin - Password:
stones1234
For security in production, this should be replaced with a proper authentication system.
Deployment
For detailed deployment instructions, see DEPLOYMENT.md.
To deploy to a server:
- Push changes to Gitea:
./push-to-gitea.sh
- Connect to your server and clone the repository:
ssh your-server-user@your-server-ip
git clone git@git.boilerhaus.org:boiler/stones.git
cd stones
- Run the deployment script:
./deploy.sh
- Update the
.env.productionfile with your production settings:
nano .env.production
- Access your application at https://contact.boilerhaus.org (or your configured domain).
Database Backups
To back up your database:
./backup-db.sh
This creates a compressed SQL backup in /var/backups/stones-database/ with a timestamp.
Project Structure
src/app: Next.js App Router pages and API routessrc/components: React componentssrc/lib: Utility functions and librariesprisma: Database schema and migrationsscripts: Data collection and processing scripts