Crosshare is a free community for crossword constructors and solvers. Crosshare is written in TypeScript using Next.js, React, and firebase.
Use GitHub issues for bug reports and feature requests.
Contributions are very much encouraged! It's recommended that you comment on (or create) the relevant issue before starting work so that we don't have multiple folks duplicating efforts simultaneously. Once you're happy with your changes please submit a pull request describing the change, any concerns, etc. PRs that include tests for the changed behavior are much more likely to be swiftly merged.
If you're looking for good issues to start out on check the good first issue tag.
We are in the process of moving to a container based dev workflow. The following steps probably won't "just work" currently, but you're welcome to try them as starting points if you're interested. If you're just trying to get up and running ASAP please scroll down to "Developing Locally"
$ podman build . --format docker --target dev -t crosshare-dev --isolation=rootless
$ podman run -it -v ./serviceAccountKey.json:/src/serviceAccountKey.json:Z -v ./app:/src/app:Z -v /src/app/node_modules -v /src/app/nextjs -w /src/app -p 3000:3000 crosshare-dev yarn dev
$ podman run -it -v ./app:/src/app:Z -v /src/app/node_modules -v /src/app/nextjs -w /src/app -p 3000:3000 -p 9199:9199 -p 9099:9099 -p 9005:9005 -p 9000:9000 -p 8085:8085 -p 8080:8080 -p 5001:5001 -p 5000:5000 -p 4500:4500 -p 4000:4000 -p 9150:9150 crosshare-dev firebase emulators:start --only auth,firestore,functions,storage --project demo-crosshare
Most of these instructions are written for unix-like OSes - folks have had success using Windows Subsystem for Linux to follow them on Windows, though.
Visit http://console.firebase.google.com/, click "add project" or "create a project". Use whatever name you'd like. You don't need to enable google analytics.
Click "Build" in the side bar, then "Authentication". Click "Get started". Click on the "Google" sign-in provider and toggle to "Enabled". Use anything you like for public facing name and enter your email as the project support email. Click "Save".
Click "Firestore Database" in the side bar. Click "Create database". Choose "start in production mode" and any storage location.
Click the little gear icon in the side bar and select "Project settings". Scroll to the "Your apps" section and click "</>" to create a web app. Register an app using whatever name you'd like. You don't need to set up hosting.
Copy the const firebaseConfig = {...}
lines from the Add Firebase SDK dialog that pops up and paste them into a new file at app/firebaseConfig.ts
. Change const firebaseConfig
to export const firebaseConfig
. These are the credentials used by the Crosshare frontend.
Now click "Continue to console" and click "Service accounts" at the top of the Project Settings page. Under "Firebase Admin SDK" click "Generate new private key". Save the resultant file as serviceAccountKey.json
in the root of this repository. This is the credential file for the Crosshare server.
Crosshare is currently deployed on node 18 - on Fedora it's:
$ sudo dnf module install nodejs:18
We use yarn
for package management:
$ sudo npm install --global yarn
Install dependencies:
$ cd app
$ yarn
While still in the app/
directory, connect to your firebase project:
$ npx firebase login
$ npx firebase use --add
Now deploy the firestore rules and indexes:
$ npx firebase deploy --only firestore
Compile the i18n definitions:
$ yarn compileI18n
Then start the server:
$ yarn dev
You should now be able to view Crosshare locally at http://localhost:3000
Note: The indexes you created with firebase deploy --only firestore
can take a while to finish building. You might get related errors when viewing the site until they are done.
When running the constructor locally you'll get an error trying to download the word database. You can follow the instructions in the deployment guide to build and upload a version to your firebase app. (TODO - we should probably provide the wordlist (maybe not the clue db) pregenerated for developers, this is a lot of work)
Once the wordlist has been updated you need to update your cloud storage CORS settings so it can be downloaded in the browser. This stackoverflow post gives a step-by-step run down.
You'll need Java installed to run the firebase emulators. Once you've done the steps above to set up local development do:
$ yarn test
See the contributors on this repository and crosshare.org/donate.
Crosshare is licensed under the GNU Affero General Public License 3.