Professional Online Survey Platform
A modern, full-stack survey platform built with React, TypeScript, and GraphQL. Create, manage, and preview professional surveys with integrated payment system.
4242 4242 4242 4242
Technology | Version | Purpose |
---|---|---|
React | 19.0.0 | UI Framework |
TypeScript | 5.7.2 | Type Safety |
Vite | 6.1.0 | Build Tool |
TailwindCSS | Latest | Styling |
Apollo Client | 3.13.0 | GraphQL Client |
React Router | 7.5.2 | Routing |
Radix UI | Latest | UI Components |
Stripe.js | 7.0.0 | Payment Processing |
React Helmet | 6.1.0 | SEO Management |
Sonner | 2.0.3 | Notifications |
Technology | Version | Purpose |
---|---|---|
Node.js | Latest | Runtime |
TypeScript | 5.7.3 | Type Safety |
Apollo Server | 4.11.3 | GraphQL API |
TypeORM | 0.3.2 | Database ORM |
PostgreSQL | 15 | Database |
Type-GraphQL | 2.0.0-rc.2 | GraphQL Schema |
Stripe | 18.0.0 | Payment Processing |
JWT | 9.0.2 | Authentication |
Argon2 | 0.41.1 | Password Hashing |
git clone https://github.com/WildCodeSchool/2409-wns-rouge-ask-and-trust.git
cd ask-and-trust
Backend (app/backend/.env
):
# Database Configuration
DB_HOST=db
DB_PORT=5432
POSTGRES_DB=ask_and_trust
POSTGRES_USER=ask_and_trust
POSTGRES_PASSWORD=superpassword
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here
# Stripe Configuration (Test Mode)
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
# Server Configuration
PORT=3310
NODE_ENV=development
Frontend (app/frontend/.env
):
VITE_GRAPHQL_ENDPOINT=http://localhost:8080/graphql
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
# Install dependencies and start all services
npm run start
This command will:
An admin account is automatically created:
admin@askandtrust.com
Password123!
ask-and-trust/
โโโ app/
โ โโโ frontend/ # React TypeScript Frontend
โ โ โโโ src/
โ โ โ โโโ components/ # Reusable UI components
โ โ โ โ โโโ sections/ # Page-specific components
โ โ โ โ โ โโโ auth/ # Authentication forms
โ โ โ โ โ โโโ landing/ # Landing page sections
โ โ โ โ โ โโโ surveys/ # Survey management
โ โ โ โ โ โโโ preview/ # Survey preview components
โ โ โ โ โ โโโ payment/ # Payment components
โ โ โ โ โโโ ui/ # Basic UI components
โ โ โ โโโ pages/ # Page components
โ โ โ โโโ hooks/ # Custom React hooks
โ โ โ โโโ contexts/ # React contexts
โ โ โ โโโ graphql/ # GraphQL queries/mutations
โ โ โ โโโ config/ # App configuration
โ โ โ โโโ types/ # TypeScript type definitions
โ โ โ โโโ styles/ # Global styles
โ โ โโโ public/ # Static assets
โ โ โโโ package.json
โ โ
โ โโโ backend/ # Node.js GraphQL Backend
โ โโโ src/
โ โ โโโ database/ # Database configuration
โ โ โ โโโ entities/ # TypeORM entities
โ โ โ โ โโโ survey/ # Survey-related entities
โ โ โ โ โโโ user.ts # User entity
โ โ โ โ โโโ payment.ts # Payment entity
โ โ โ โโโ config/ # Database config
โ โ โโโ graphql/ # GraphQL schema
โ โ โ โโโ resolvers/ # GraphQL resolvers
โ โ โ โโโ inputs/ # Input type definitions
โ โ โโโ services/ # Business logic services
โ โ โโโ middlewares/ # Express middlewares
โ โ โโโ scripts/ # Utility scripts
โ โ โโโ server.ts # Application entry point
โ โโโ package.json
โ
โโโ nginx/ # Nginx configuration
โโโ docs/ # Project documentation
โโโ docker-compose.yaml # Docker services configuration
โโโ docker-compose.prod.yaml # Production configuration
โโโ package.json # Root package.json for workspaces
# Install dependencies and setup
npm run prepare
# Start development environment
npm run start
# Code formatting
npm run format
npm run prettier:check
# Linting
npm run lint
# Documentation generation
npm run docs
# Release management
npm run release # Auto-increment version
npm run release:patch # Patch version (1.0.1)
npm run release:minor # Minor version (1.1.0)
npm run release:major # Major version (2.0.0)
# Conventional commits
npm run commit # Interactive commit with commitizen
# Register a new user
mutation RegisterUser($data: CreateAuthInput!) {
register(data: $data) {
id
email
role
}
}
# Login user
mutation LoginUser($data: CreateAuthInput!) {
login(data: $data) {
user {
id
email
role
}
token
}
}
# Get all surveys
query GetSurveys {
surveys {
id
title
description
public
category {
name
}
questions {
id
title
type
answers {
value
}
}
}
}
# Create a survey
mutation CreateSurvey($data: CreateSurveyInput!) {
createSurvey(data: $data) {
id
title
description
}
}
# Create payment intent
mutation CreatePaymentIntent($data: CreatePaymentInput!) {
createPaymentIntent(data: $data)
}
The platform includes a comprehensive survey preview system:
http://localhost:8080/surveys/preview/mock
http://localhost:8080/surveys/preview/0
, /1
, /2
, etc.The mock survey showcases a complete customer satisfaction survey with:
# Build and start production environment
docker-compose -f compose.prod.yaml up --build
Update the production environment files with:
npm run docs
git checkout -b feature/amazing-feature
)npm run commit
)git push origin feature/amazing-feature
)We use Conventional Commits:
feat:
New featuresfix:
Bug fixesdocs:
Documentation changesstyle:
Code style changesrefactor:
Code refactoringtest:
Adding testschore:
Maintenance tasksThis project is licensed under the GPL-2.0 License - see the LICENSE file for details.
Authors: YohanGH, AlexDDevv, ArthurVS05, corenthin95
School: Wild Code School - 2409 WNS Rouge
For support and questions:
Made with โค๏ธ by the Ask&Trust team ๐